/*
	YoghurtGum - 2D Game Engine

	Copyright 2009-2011 Quinten Lansu
	
	Licensed under the Apache License, Version 2.0 (the "License"); you may not 
	use this file except in compliance with the License. You may obtain a copy 
	of the License at 
		
		http://www.apache.org/licenses/LICENSE-2.0 
		
	Unless required by applicable law or agreed to in writing, software 
	distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 
	WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 
	License for the specific language governing permissions and limitations 
	under the License. 
*/

#ifndef _SPRITEDIRECT3D_H_
#define _SPRITEDIRECT3D_H_

#include "RenderMethodDirect3D.h"
#include "..\..\..\YoghurtGum\src\Color.h"
#include "..\..\..\YoghurtGum\src\Vec2.h"

namespace YoghurtGum
{

	class SpriteDirect3D : public Sprite
	{

	public:

		SpriteDirect3D();
		SpriteDirect3D(const char* a_File);
		~SpriteDirect3D() { }

		void SetAlphaKey(Color a_AlphaKey = Color());

		void Load(const char* a_File);

		void Scale(float a_Width, float a_Height);
		void Rotate(float a_Degrees);

		void Draw(float a_X, float a_Y, float a_Depth);

	private:

		void SetVertices();

		char m_FileName[256];
		Vertex* m_Vertices;
		Vertex m_BaseVertices[6];
		D3DMCOLOR m_AlphaKey;
		bool m_Loaded;
		D3DMMATRIX m_Transformation;
		LPDIRECT3DMOBILETEXTURE m_Texture;
		LPDIRECT3DMOBILEVERTEXBUFFER m_VertexBuffer;

		Vec2 
			m_BaseUpperLeft, m_BaseUpperRight, 
			m_BaseLowerLeft, m_BaseLowerRight;		
		Vec2 
			m_UpperLeft, m_UpperRight,
			m_LowerLeft, m_LowerRight;

	};

}; // namespace YoghurtGum

#endif